/**
 * 
 */
package com.hp.sso;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.view.AbstractView;

import com.alibaba.fastjson.JSONObject;
import com.hp.authweb.bean.Result;

/**
 * <p>Description:绑定/解绑
 * @author 胡鹏
 * @date 2018年11月29日
 */
public class MyConnectView extends AbstractView {

	@Override
	protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		response.setContentType("text/html;charset=UTF-8");
		if (model.get("connections") == null) {
			response.getWriter().write(JSONObject.toJSONString(Result.success("解绑成功")));
		} else {
			//绑定成功跳转成功页面并传递参数
			response.sendRedirect("/socialSingin.html?result=1");
		}
	}
}
